Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression.
与えられた文字列表式の最初の文字について、該当する ASCII (American Standard Code for Information Interchange) コードを返します。
Asc (Text As String)
Asc (Text As String)
Integer
整数
Text: Any valid string expression. Only the first character in the string is relevant.
Text: 変換させる文字列表式。変換対象は、文字列の最初の文字だけです。
Use the Asc function to replace keys with values. If the Asc function encounters a blank string, Office Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters.
Asc 関数は、キーを値に置換する際に使用します。Asc 関数が空白文字列を検出すると、Office Basic は実行時エラーを返します。ASCII 関数は、7 ビットの ASCII 文字 (コード 0 から 127) だけでなく、ASCII コード中に含まれる非印刷用のキーコードも検出できます。またこの関数は、16 ビット unicode 文字も処理できます。
Sub ExampleASC
Sub ExampleASC
Print ASC("A") REM returns 65
Print ASC("A") REM 戻り値は 65
Print ASC("Z") REM returns 90
Print ASC("Z") REM 戻り値は 90
Print ASC("Las Vegas") REM returns 76, since only the first character is taken into account
Print ASC("Las Vegas") REM 認識されるのは最初の文字だけなので、戻り値は 76
End Sub
End Sub